<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>图文管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/phy/tArticle/">图文列表</a></li>
		<li class="active"><a href="${ctx}/phy/tArticle/form?id=${tArticle.id}">图文<shiro:hasPermission name="phy:tArticle:edit">${not empty tArticle.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="phy:tArticle:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="tArticle" action="${ctx}/phy/tArticle/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>

		<sys:message content="${message}"/>
		<form:hidden path="tenantId" value="5"/>
<%--		<c:if test="${empty admin.tenantId}" >--%>
<%--			<div class="control-group" >--%>
<%--				<label class="control-label">所属机构:</label>--%>
<%--				<div class="controls">--%>
<%--					<sys:treeselect id="tenant" name="tenantId" value="${tArticle.tenantId}" labelName="tenantName" labelValue="${tArticle.tenant.tenantName}"--%>
<%--									title="租户" url="/tenant/tTenant/treeData" cssClass="required" notAllowSelectParent="true"/>--%>
<%--					<span class="help-inline"><font color="red">*</font> </span>--%>
<%--				</div>--%>
<%--			</div>--%>
<%--		</c:if>--%>
<%--		<c:if test="${not empty admin.tenantId}">--%>
<%--			<form:hidden path="tenantId" value="${admin.tenantId}"></form:hidden>--%>
<%--		</c:if>--%>
		<div class="control-group" >
			<label class="control-label">所属分类:</label>
			<div class="controls">
				<sys:treeselect id="type" name="type" value="${tArticle.type}" labelName="typeName" labelValue="${tArticle.tArticleType.typeName}"
								title="分类" url="/phy/tArticleType/treeData" cssClass="required" notAllowSelectParent="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">标题：</label>
			<div class="controls">
				<form:input path="title" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">链接：</label>
			<div class="controls">
				<form:input path="link" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">标题颜色：</label>--%>
<%--			<div class="controls">--%>
<%--				<form:input path="color" htmlEscape="false" maxlength="50" class="input-xlarge "/>--%>
<%--			</div>--%>
<%--		</div>--%>
		<div class="control-group">
			<label class="control-label">封面图：</label>
			<div class="controls">
				<form:hidden path="image" />
				<sys:selectFile input="image" type="thumb" uploadNum="1" />
			</div>
		</div>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">关键字：</label>--%>
<%--			<div class="controls">--%>
<%--				<form:input path="keywords" htmlEscape="false" maxlength="255" class="input-xlarge "/>--%>
<%--			</div>--%>
<%--		</div>--%>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">描述、摘要：</label>--%>
<%--			<div class="controls">--%>
<%--				<form:input path="description" htmlEscape="false" maxlength="255" class="input-xlarge "/>--%>
<%--			</div>--%>
<%--		</div>--%>
		<div class="control-group">
			<label class="control-label">排序：</label>
			<div class="controls">
				<form:input path="weight" htmlEscape="false" maxlength="11" class="input-mini "/>
			</div>
		</div>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">权重期限：</label>--%>
<%--			<div class="controls">--%>
<%--				<input name="weightDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "--%>
<%--					value="<fmt:formatDate value="${tArticle.weightDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"--%>
<%--					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>--%>
<%--			</div>--%>
<%--		</div>--%>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">点击数：</label>--%>
<%--			<div class="controls">--%>
<%--				<form:input path="hits" htmlEscape="false" maxlength="11" class="input-xlarge "/>--%>
<%--			</div>--%>
<%--		</div>--%>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">推荐位，多选：</label>--%>
<%--			<div class="controls">--%>
<%--				<form:input path="posid" htmlEscape="false" maxlength="10" class="input-xlarge "/>--%>
<%--			</div>--%>
<%--		</div>--%>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">自定义内容视图：</label>--%>
<%--			<div class="controls">--%>
<%--				<form:input path="customContentView" htmlEscape="false" maxlength="255" class="input-xlarge "/>--%>
<%--			</div>--%>
<%--		</div>--%>
<%--		<div class="control-group">--%>
<%--			<label class="control-label">图文：</label>--%>
<%--			<div class="controls">--%>
<%--				<form:textarea id="content" htmlEscape="false" path="content" rows="6" class="input-xxlarge "/>--%>
<%--				<sys:ckeditor replace="content" uploadPath="/cms/article" />--%>
<%--			</div>--%>
<%--		</div>--%>
		<div class="control-group">
			<label class="control-label">发布时间：</label>
			<div class="controls">
				<input name="pushDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${tArticle.pushDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="phy:tArticle:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
